﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace qiniuUI
{
    public partial class option : Form
    {
        public option()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.Fixed3D;
            option_ak.Text = ConfigHelper.GetConnectionStringsConfig("ak");
            option_sk.Text = ConfigHelper.GetConnectionStringsConfig("sk");
            option_source.Text = ConfigHelper.GetConnectionStringsConfig("bucket");
            option_dst.Text = ConfigHelper.GetConnectionStringsConfig("dst_bucket");
            option_url.Text = ConfigHelper.GetConnectionStringsConfig("server_url");

        }

        private void option_Load(object sender, EventArgs e)
        {

        }

        private void option_sure_Click(object sender, EventArgs e)
        {
            List<string> name = new List<string>();
            List<string> text= new List<string>();
            name.Add("ak"); text.Add(option_ak.Text);
            name.Add("sk"); text.Add(option_sk.Text);
            name.Add("bucket"); text.Add(option_source.Text);
            name.Add("dst_bucket"); text.Add(option_dst.Text);
            name.Add("server_url"); text.Add(option_url.Text);
            name.Add("downpath"); text.Add(downpath.Text);
            ConfigHelper.change_config_txt(name, text);
            this.DialogResult = DialogResult.OK;
        }
    }
}
